package org.spring.springboot.atomikos.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TestService {

	@Autowired
	private JdbcTemplate sysJdbcTemplate;

	@Autowired
	private JdbcTemplate busJdbcTemplate;

	@Transactional
	public void test() {
		System.out.println("begin.....");
		sysJdbcTemplate.execute("insert into user (id, username, password, enable) values(66,'wangwu5555','wangwupassword','1')");
		busJdbcTemplate.execute("insert into user (id, username, password, enable) values(64,'lisi9999','lisi9999','1')");
		System.out.println("end.....");
	}
}
